home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
pibcalc.arc
/
TRYEDIT.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1985-03-06
|
1KB
|
69 lines
(*C-,U-,B-*)
PROGRAM TryEdit;
TYPE
AnyStr = STRING[255];
VAR
S: AnyStr;
C: Char;
Procedure Help;
Begin (* Help *)
End (* End *);
Procedure Click;
Begin (* Click *)
End (* Click *);
Function Trim( S : AnyStr ) : AnyStr;
VAR
I: INTEGER;
Trimmed: BOOLEAN;
BEGIN (* Trim *)
Trim := '';
IF LENGTH( S ) > 0 THEN
BEGIN
I := LENGTH( S ) + 1;
Trimmed := FALSE;
REPEAT
I := I - 1;
IF ( I > 0 ) THEN
Trimmed := S[I] <> ' '
ELSE
Trimmed := TRUE;
UNTIL Trimmed;
IF ( I > 0 ) THEN Trim := COPY( S, 1, I );
END;
END (* Trim *);
(*$I DUPL.PAS *)
(*$I GETSTR.PAS *)
BEGIN (* TryEdit *)
Write('Enter string to be edited: ');
Readln( S );
C := Edit_String( S, 80, 1, WhereY + 1, FALSE );
S := Trim( S );
Writeln;
Writeln;
Writeln('Edited string: ',S);
END (* TryEdit *).